package com.thunbu.thunbu_meeting_system.dialog

import android.app.Activity
import android.view.View
import android.widget.TextView
import com.lxj.xpopup.core.BasePopupView

import com.lxj.xpopup.core.BottomPopupView

import com.thunbu.thunbu_meeting_system.R
import kotlinx.android.synthetic.main.dialog_operate.view.*

class OperatPop( val activity: Activity,val func:(status:Int)->Unit,val isAdapter1:Boolean): BasePopupView(activity) {
    override fun getPopupLayoutId(): Int = R.layout.dialog_operate




    override fun onCreate() {
        super.onCreate()
        val tv_plpy = findViewById<TextView>(R.id.tv_plpy)
        val tv_plpk = findViewById<TextView>(R.id.tv_plpk)
        val tv_cancel = findViewById<TextView>(R.id.tv_cancel)


        if(isAdapter1){
            tv_plpy.setOnClickListener {
                func(1)
                dismiss()
            }

            tv_plpk.setOnClickListener {
                func(2)
                dismiss()
            }
        }else{
            tv_plpy.text = "批量撤回"
            tv_plpy.setOnClickListener {
                func(0)
                dismiss()
            }
            tv_plpk.visibility = View.GONE
        }

        tv_cancel.setOnClickListener {
            dismiss()
        }

    }


}